cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper III
Helper III

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
Highlighted
Helper III
Helper III

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
Highlighted
Community Support
Community Support

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.
Highlighted
Helper III
Helper III

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
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Users online (7,474)