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

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 II
Helper II

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 II
Helper II

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
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

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

Users online (7,504)