如果您对文件accountCreator.js中sobjectField类型的引用Account.BillingCountryCode无效感兴趣,那么本文将是一篇不错的选择,我们将为您详在本文中,您将
如果您对文件 accountCreator.js 中 sobjectField 类型的引用 Account.BillingCountryCode 无效感兴趣,那么本文将是一篇不错的选择,我们将为您详在本文中,您将会了解到关于文件 accountCreator.js 中 sobjectField 类型的引用 Account.BillingCountryCode 无效的详细内容,并且为您提供关于ActionView::SyntaxErrorInTemplate in AccountsController#profile、Android M – GoogleAccountCredential setSelectedAccount不起作用 – 名称不能为null、android – AccountPicker.newChooseAccountIntent,在选择帐户时关闭对话框、android – 使用AccountPicker.newChooseAccountIntent选择一封电子邮件的有价值信息。
本文目录一览:- 文件 accountCreator.js 中 sobjectField 类型的引用 Account.BillingCountryCode 无效
- ActionView::SyntaxErrorInTemplate in AccountsController#profile
- Android M – GoogleAccountCredential setSelectedAccount不起作用 – 名称不能为null
- android – AccountPicker.newChooseAccountIntent,在选择帐户时关闭对话框
- android – 使用AccountPicker.newChooseAccountIntent选择一封电子邮件
文件 accountCreator.js 中 sobjectField 类型的引用 Account.BillingCountryCode 无效
如何解决文件 accountCreator.js 中 sobjectField 类型的引用 Account.BillingCountryCode 无效?
我尝试获取 salesforce 默认字段但失败了。 错误信息是:
force-app/main/default/lwc/accountCreator/accountCreator.js 无效 参考文件中 sobjectField 类型的 Account.BillingCountryCode accountCreator.js
我的代码在这里:
import { LightningElement,wire,api } from ''lwc'';
import { getRecord,getFieldValue } from ''lightning/uiRecordApi'';
import ACCOUNT_OBJECT from ''@salesforce/schema/Account'';
import NAME_FIELD from ''@salesforce/schema/Account.Name'';
import ParentId_FIELD from ''@salesforce/schema/Account.ParentId'';
import BillingCountryCode_FIELD from ''@salesforce/schema/Account.BillingCountryCode'';
import BillingCountry_FIELD from ''@salesforce/schema/Account.BillingCountry'';
const fields = [NAME_FIELD,ParentId_FIELD,BillingCountry_FIELD,BillingCountryCode_FIELD];
export default class AccountCreator extends LightningElement {
@api recordId;
@wire(getRecord,{ recordId: ''$recordId'',fields })
account;
get name() {
return getFieldValue(this.account.data,NAME_FIELD);
}
get parentId() {
return getFieldValue(this.account.data,ParentId_FIELD);
}
get countryCode() {
return getFieldValue(this.account.data,BillingCountryCode_FIELD);
}
get country() {
return getFieldValue(this.account.data,BillingCountry_FIELD);
}
connectedCallback() {
console.log(''recordId=='',this.recordId,'' ACCOUNT_OBJECT=='',...ACCOUNT_OBJECT);
}
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)
ActionView::SyntaxErrorInTemplate in AccountsController#profile
如何解决ActionView::SyntaxErrorInTemplate in AccountsController#profile?
当结束时意外结束,但我看不出问题出在哪里。 我的终端不断给我错误:ActionView::SyntaxErrorInTemplate(渲染模板时遇到语法错误:
我的 profile.html.erb
<% if @users.image.present? %>
<%= image_tag @users.image %>
<% end %>
<strong><h1><%= @users.full_name %></h1></strong>
<% if user_signed_in? %>
<% if @user == current_user %>
<%= link_to"Edit Profile",edit_user_registration_path(@user) %>
<% if user_signed_in? && !@user? %>
<% if current_user.following?(@user) %>
<%= link_to"Unfollow",follows_path(user_id: @user.id),method: :delete %>
<% else %>
<%= link_to"Follow",follows_path(user_id: @user.id) %>
<% end %>
<% end %>
<% end %>
<% end %>
<div> <%= @users.posts.count %> Posts </div>
<p><%= @users.full_name %></p>
<p><%= @users.description %></p>
<p><%= link_to @users.website if @users.website.present? %></p>
<%= @posts.each do |post|%>
<%= image_tag post.image %>
<% end %>
解决方法
问题似乎在这里
<p><%= link_to @users.website if @users.website.present? %></p>
改成
<p><%= link_to ''User Website'',@users.website if @users.website.present? %></p>
,
<% if user_signed_in? && @user == current_user %>
<%= link_to"Edit Profile",edit_user_registration_path(@user) %>
<% if current_user.following?(@user) %>
<%= link_to"Unfollow",follows_path(user_id: @user.id),method: :delete %>
<% else %>
<%= link_to"Follow",follows_path(user_id: @user.id) %>
<% end %>
<% end %>
现在好了:D
,我看到了两个错误,请纠正。首先,没有什么 @user?
是最大的错误,另一个可能不是问题,但没有空间 <%= link_to"Edit Profile"
请尝试以下代码,我已更改内容并正确重新格式化。
<% if @users.image.present? %>
<%= image_tag @users.image %>
<% end %>
<strong><h1><%= @users.full_name %></h1></strong>
<% if user_signed_in? %>
<% if @user == current_user %>
<%= link_to "Edit Profile",edit_user_registration_path(@user) %>
<% if user_signed_in? && !@user %>
<% if current_user.following?(@user) %>
<%= link_to"Unfollow",method: :delete %>
<% else %>
<%= link_to"Follow",follows_path(user_id: @user.id) %>
<% end %>
<% end %>
<% end %>
<% end %>
<div> <%= @users.posts.count %> Posts </div>
<p><%= @users.full_name %></p>
<p><%= @users.description %></p>
<p><%= link_to @users.website if @users.website.present? %></p>
<%= @posts.each do |post|%>
<%= image_tag post.image %>
<% end %>
Android M – GoogleAccountCredential setSelectedAccount不起作用 – 名称不能为null
在Android M-Preview上,GoogleAccountCredential.setSelectedAccount似乎不起作用.
调试时,我注意到在调用该方法后,该对象的selectedAccount和accountName字段仍然为null.
在调试时,您可以看到我的变量accountName不为空或null,我调用.setSelectedAccountName(),但正如您在调试窗口中看到的那样,GoogleAccountCredential中的字段仍为空.
我认为这可能与某些权限有关?在我的清单上,我声明了以下权限:
我知道你在M上免费获得GET_ACCOUNTS许可(根据https://developer.android.com/preview/features/runtime-permissions.html#normal),但M-Preview的其他两个权限是“未知”.也许吧,那就是那个?
最佳答案
android.permission.GET_ACCOUNTS有protectionLevel:dangerous,现在是Contacts权限组的一部分,这意味着你应该在运行时使用新的Activity.requestPermissions()来请求它.
只有这样,您才能与设备上其他应用创建的帐户进行互动.
android – AccountPicker.newChooseAccountIntent,在选择帐户时关闭对话框
我正在尝试使用Google Play服务生成的意图来选择Google帐户
private void showGoogleAccountPicker() {
Intent googlePicker = AccountPicker.newChooseAccountIntent(null, null,
new String[] { GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE }, true, null, null, null, null);
startActivityForResult(googlePicker, PICK_ACCOUNT_REQUEST);
}
@Override
protected void onActivityResult(final int requestCode, final int resultCode, final Intent data) {
if (requestCode == PICK_ACCOUNT_REQUEST && resultCode == RESULT_OK) {
String accountName = data.getStringExtra(AccountManager.KEY_ACCOUNT_NAME);
Log.d(TAG, "Account Name=" + accountName);
}
}
该对话框显示我的Google帐户以及创建新帐户的选项.
如果我选择“添加帐户”选项,我已正确地重定向到帐户创建向导,但如果我选择现有帐户并单击“确定”,则对话框将关闭,但它永远不会返回到活动
Logcat只打印此行.我认为它没有任何关系.
W/IInputConnectionWrapper(23576): showStatusIcon on inactive InputConnection
来源
http://gmariotti.blogspot.com.es/2013/03/snippet-google-picker-account.html
http://developer.android.com/reference/com/google/android/gms/common/AccountPicker.html
解决方法:
事实证明我的Activity不在Back Stack中,因为我在Manifest中明确要求它
<activity
android:name=".ui.LoginActivity"
android:label="@string/app_name"
android:noHistory="true"
所以Dialog找不到任何人将结果返回给.
多么浪费时间:(
android – 使用AccountPicker.newChooseAccountIntent选择一封电子邮件
我试图让用户使用以下代码选择一个电子邮件帐户:
Intent intent = AccountPicker.newChooseAccountIntent(null, null, new String[]{"com.google"},
false, null, null, null, null);
startActivityForResult(intent, 23);
此代码效果很好,但如果用户没有Gmail帐户,但雅虎,Hotmail等.
如何通过更改第三个参数来显示所有电子邮件帐户:
new String[]{"com.google"}
非常感谢你
解决方法:
根据文档,第三个参数是allowableAccountTypes:
allowableAccountTypes
an optional string array of account types. These are used both to filter the shown accounts and to filter the list of account types that are shown when adding an account.
对于电子邮件应用中的IMAP帐户,该类型将作为“com.google.android.legacyimap”返回(请不要在生产中记录帐户的详细信息):
AccountManager accountManager = AccountManager.get(getApplicationContext());
Account[] accounts = accountManager.getAccountsByType(null);
for (Account account : accounts) {
Log.d(TAG, "account: " + account.name + " : " + account.type);
}
正在使用(将所需的所有帐户类型添加到数组中)
Intent intent = AccountPicker.newChooseAccountIntent(null, null,
new String[] {"com.google", "com.google.android.legacyimap"},
false, null, null, null, null);
正在我的设备上返回以下内容:
请注意,AccountPicker
课程是Google Play服务包的一部分,可以使用AccountManager.newChooseAccountIntent()
(在API级别14中添加)来获得相同的结果.
希望这可以帮助.
今天关于文件 accountCreator.js 中 sobjectField 类型的引用 Account.BillingCountryCode 无效的介绍到此结束,谢谢您的阅读,有关ActionView::SyntaxErrorInTemplate in AccountsController#profile、Android M – GoogleAccountCredential setSelectedAccount不起作用 – 名称不能为null、android – AccountPicker.newChooseAccountIntent,在选择帐户时关闭对话框、android – 使用AccountPicker.newChooseAccountIntent选择一封电子邮件等更多相关知识的信息可以在本站进行查询。
本文标签: