cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
aboodhamwi
Level: Powered On

An attribute is being ignored using Patch

Hi,

 

I'm trying to create a quote record in the CDS using the Patch function

 

Set(CreatedQuote,
    Patch(
        Quotes,
        Defaults(Quotes),
        {
            name: Concatenate(
                "Leasing Devices for ",
                SelectedCustomer.name
            ),
            _customerid_value: SelectedCustomer,
            msdyn_account: SelectedCustomer,
            ets_ServiceType: SelectedServiceType,
   
            ets_installmentfrequency: SelectedInstallmentFrequency,
            ets_installmentmethod: SelectedInstallmentMethod,
            effectivefrom: Today(),
            effectiveto: DateAdd(
                Today(),
                30,
                Days
            ),
            ets_agreementwillhavedifferentenddate: false,
            ets_assetcontractinvoicetype: 'Asset Contract Invoice Type'.'Service Value',
            ets_customerwillowntheasset: chboxCustomerWillOwnTheAssetInTheEnd.Value,
            ets_digitaldocumentaccepted: chboxDigitalDocumentAccepted.Value,
            ets_duration: Value(tboxDuration.Text),
            ets_informationcreatedinresco: true,
            ets_isrenewalquote: false,
            ets_serviceduringoperationhours: chboxServiceWillBeDoneDuringWorkingHOurs.Value,
            ets_terminationcondition: chboxTerminationCondition.Value,
            msdyn_ordertype: 'Order Type (Quotes)'.'Service-Maintenance Based'
        }
    )
);

for some reason the _customerid_value is being ignored, this is the request 

image.png

if you can notice the msdyn_account is there but the _customerid_value is missing, any ideas

 

1 ACCEPTED SOLUTION

Accepted Solutions
aboodhamwi
Level: Powered On

Re: An attribute is being ignored using Patch

Hi @v-yutliu-msft ,

 

It turns out, i checked the "Relational data, Option Sets, and other new features for CDS" as yes, so in my case, the type customer field in quote entity is Polymorphic, and so far as per the documentation you can only edit the companyname field in the contact entity, other polymorphic fields still read-onlyimage.png

View solution in original post

2 REPLIES 2
Community Support Team
Community Support Team

Re: An attribute is being ignored using Patch

Hi @aboodhamwi ,

Since _customerid_value shoulde be a guid, Selectedcustomer is not a guid.

I suggest you transfer the value of Selectedcustomer to a guid value.

 

 

Best regards,

Community Support Team _ Phoebe Liu

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
aboodhamwi
Level: Powered On

Re: An attribute is being ignored using Patch

Hi @v-yutliu-msft ,

 

It turns out, i checked the "Relational data, Option Sets, and other new features for CDS" as yes, so in my case, the type customer field in quote entity is Polymorphic, and so far as per the documentation you can only edit the companyname field in the contact entity, other polymorphic fields still read-onlyimage.png

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Users Online
Currently online: 173 members 5,556 guests
Please welcome our newest community members: