Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Suggested answer

Copy Data Source Error

Posted on by 160

Hi,

I want to copy data sources to other form, but after I copy to the form and I saved an error appears.

Add-Field-Different-Form-2.jpg

Add-Field-Different-Form-3.jpg

how to solve this problem ?

thanks,

  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 230,188 Most Valuable Professional on at
    RE: Copy Data Source Error

    Now you should think about how you want to implement this requirement. You must have such an idea before you start writing code, copying data source and so on.

    I think that inner-joining SalesLine with SalesPackingSlipTrans will do the job. Therefore drag SalesLine table to the data form and set a suitable name. Then set JoinSource property to CustPackingSlipTrans and LinkType to InnerJoin.

    But it's still s not sufficient. To be able to join two data source, they must have a relation, which doesn't seem to be the case. Therefore go to SalesPackingSlipTrans table and add a relation to SalesLine (SalesPackingSlipTrans.InventTransId == SalesLine.InventTransId).

  • RSI Profile Picture
    RSI 160 on at
    RE: Copy Data Source Error

    Hi Martin Dráb,

    I want display "Packing unit" in sales order line (tab packing) to packing slip journals.

    Step “Packing unit”  : Module “Sales and Marketing” => Sales orders => All sales orders => double click one of sales order => go to “Line details” and click => tab packing => packing material => “Packing unit”

    Step “Packing slip journals” : module “sales and marketing” => Inquiries =>  Journals => packing slip => tab “overview”

    step-8.jpg

    thanks

  • Martin Dráb Profile Picture
    Martin Dráb 230,188 Most Valuable Professional on at
    RE: Copy Data Source Error

    The table contains the same data regardless of which form is using it. But it doesn't mean that you always fetch the same records - you can apply filters, joins and so on.

    In your case, you seem to want to join a table to the packing slip, but you didn't do it (or at least didn't mention it).

    Unfortunately it's not clear to me what exactly you want to achieve. Could you explain it in detail, please?

  • HenryXie Profile Picture
    HenryXie on at
    RE: Copy Data Source Error

    Hi RSI,

    you can use display method ,  but display field cannot support filter in the grid.

    community.dynamics.com/.../display-method-on-a-datasource-in-a-grid-control

    docs.microsoft.com/.../using-the-display-method-modifier

  • RSI Profile Picture
    RSI 160 on at
    RE: Copy Data Source Error

    Hi Martin Dráb             ,

    Right, i mean dragging the table to a form , if i create new table to this form, will the contents of the data source be the same?

    actually I want to add the packing field in the sales table to the journal packing slip. because I tried to drag it, the field appears but the data doesn't appear.

    any suggestions ?

    Thanks.

  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 230,188 Most Valuable Professional on at
    RE: Copy Data Source Error

    The first error says that updateDesign() method contains a variable called SalesLine, and you added a data source with the same name. You can't have two variables with the same name (both valid in the same scope). You must rename either the variable, or the data source. I would rename the data source and kept standard code intact.

    The other errors are about methods that you copied with the data source and which don't make sense in the other form. Are you sure that copying the whole data source is a good idea? A normal approach is dragging the table to a form (which creates a new data source for this tables), not copying a data source from another form. If you want to do it anyway, it's up to you to review and fix all the code.

    By the way, your question is clearly about development, therefore I changed the category from "Other" to "Development / Customization / SDK".

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans